struct dirent {
	unsigned char d_name[32];
};

void main(int argc, char *argv)
{	
	struct dirent dirent[32];
	int i, dir_num;
	int fd;
	char filename[1024];

	// printf("this is %s(): %d >>> argc = %d\r\n", __func__, __LINE__, argc);
	// printf("this is %s(): %d >>> argv = %x\r\n", __func__, __LINE__, argv);
	// printf("this is %s(): %d >>> argv = %s\r\n", __func__, __LINE__, argv);

	// if (!argv) {
		getcwd(filename, sizeof(filename));
	// } else {
	// 	strcpy(filename, argv);
	// }

	printf("this is %s(): %d >>> filename = %s\r\n", __func__, __LINE__, filename);

	fd = open(filename, 0 ,0);
	printf("this is %s(): %d >>> fd = %d\r\n", __func__, __LINE__, fd);

	dir_num = readdir(fd, dirent);
	for (i = 0; i < dir_num; i++) {
		printf("%s  ", dirent[i].d_name);
	}
	printf("\r\n");

	exit();
}
